JSONParse

Returns a value after parsing an object using JSON syntax.

Note: User arrays are treated as objects. To convert between a user array and JSONArray, use the ArrayToJSONArray statement.

Syntax

JSONParse("JSON")

Arguments

Argument Description
JSON Object to parse. Can be a number, Boolean, null, string, JSONArray, JSONObject, or other data type.

If a string is used, a string, JSONObject, JSONArray, integer, float, Boolean, or null may be returned. Strings must be wrapped in backslashes and double quotation marks (\") to be parsed as JSON. For example, x = "\"This is a string\"".

If a JSONObject or JSONArray is used, a copy is created and returned. If another data type is used, the object is converted to a string before parsing.

Return value

Value Description
Value Value from the parsed object.

Example

jsonObject = JSONParse("{\"propertyName\": \"propertyValue\"}")

PrintLn("Should be \"{\"propertyName\":\"propertyValue\"}\": " & jsonObject)